package com.woniu.controller.medicalService;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.woniu.model.medicalService.entity.DictionaryMS;
import com.woniu.model.gh.common.Result;
import com.woniu.service.medicalService.IDictionaryMSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//字典表
@RestController
@RequestMapping("/ms_dictionary")
public class DictionaryMSController {

    @Autowired
    private IDictionaryMSService dictionaryService;

    //根据类型id查找
    @GetMapping("/findByTypeId")
    public Result<List<DictionaryMS>> findByTypeId(Long typeId){
        List<DictionaryMS> list = dictionaryService.list(
                Wrappers.lambdaQuery(DictionaryMS.class)
                        .eq(DictionaryMS::getTypeId, typeId));
        return Result.ok(list);
    }

}
